package com.ttxs.generator.output.java;

import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.ttxs.generator.engine.CustomFreemarker;
import com.ttxs.generator.output.Output;

import java.io.File;
import java.io.IOException;

public class R implements Output {
    @Override
    public void write(CustomFreemarker templateEngine) throws IOException {
        String path = templateEngine.hasModule()
                ? templateEngine.getCustomParentPath() + File.separator + OutputFile.other
                : templateEngine.getPathInfo(OutputFile.other);
        File resultJava = new File(path + File.separator + "R.java");
        templateEngine.outputFile(resultJava, templateEngine.customMap(), "templates/r.java.ftl");
    }
}
